package model
import (
	"fmt"
)

type account struct{
	accountNo string
	balance float64
	password string
}

func AccountFactory(accountNo string,balance float64,password string)*account{
	if len(accountNo) < 6 || len(accountNo) > 10{
		fmt.Println("账号必须在6-10个字符")
		return nil
	}
	if balance <= 20{
		fmt.Println("账号余额必须大于20元")
		return nil
	}
	if len(password) != 6{
		fmt.Println("账号密码必须是6位")
		return nil
	}
	return &account{
		accountNo : accountNo,
		balance : balance,
		password : password,
	}
}

